<script setup lang="ts">
import {ref} from "vue";
import emitter from "@/utils/emitter";

let toy = ref('奥特曼')
</script>

<template>
<h2>子组件1</h2>
  <h3>玩具：{{toy}}</h3>
  <button @click="emitter.emit('send-toy', toy)">给出玩具</button>
</template>

<style scoped>

</style>